package com.zmn.oms.services.impl.chan;

import com.zmn.oms.model.entity.chan.FacadeMessage;
import com.zmn.oms.persistence.interfaces.chan.FacadeMessageDAO;
import com.zmn.oms.services.interfaces.chan.FacadeMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 类描述：
 *
 * @author lhl
 * @date 2021-01-04 10:55:09
 */
@Service("facadeMessageService")
public class FacadeMessageServiceImpl implements FacadeMessageService {

    @Resource
    private FacadeMessageDAO facadeMessageDAO;

    /**
     * 查询通过指定渠道接入口接入的渠道
     * @return
     */
    @Override
    public List<FacadeMessage> listLimit() {
        return facadeMessageDAO.listLimit();
    }

    /**
     * 保存
     * @param facadeMessage
     * @return
     */
    @Override
    public int save(FacadeMessage facadeMessage) {
        return facadeMessageDAO.insert(facadeMessage);
    }


    /**
     * 通过线索Id查询全部消息
     * @param clueId
     * @return
     */
    @Override
    public List<FacadeMessage> listByClueId(long clueId) {
        return facadeMessageDAO.listByClueId(clueId);
    }

    /**
     * 通过线索Id查询指定编号的消息
     * @param clueId
     * @param msgNo
     * @return
     */
    @Override
    public FacadeMessage findByClueIdAndMsgNo(long clueId, int msgNo) {
        return facadeMessageDAO.findByClueIdAndMsgNo(clueId, msgNo);
    }
}
